import request from '@/utils/request'

// 获取员工列表
export const getEmployeeList = params => request.get('/sys/user', { params })

// 分配角色
export const putRole = data => request.put('/sys/user/assignRoles', data)

// 获取员工-基本信息
export const getEmployeeInfo = id => request.get(`/sys/user/${id}`)

// 删除员工
export const delEmployee = id => request.delete(`/sys/user/${id}`)

// 新增员工
export const addEmployee = data => request.post('/sys/user', data)

// 批量导出员工excel
export const getEmployeeExcel = () => request.get('/sys/user/export', {
  responseType: 'blob'
})
// 导出员工excel模板
export const getEmployeeModuleExcel = () => request.get('/sys/user/import/template', {
  responseType: 'blob'
})

// 导入员工列表
export const postEmployeeExcel = file => request.post('/sys/user/import', file)

// 修改-员工-基本信息
export const putEmployeeInfo = data => request.put(`/sys/user/${data.id}`, data)
